﻿using iTaskService.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.Text;

namespace iTaskService
{
    
    public class TaskService : ITaskService
    {
        // Validate from database
        public bool IsUser(string username, string password)
        {
            ITaskDataConnectDataContext db = new ITaskDataConnectDataContext();
            ACCOUNT result= db.ACCOUNTs.SingleOrDefault(p => p.Name == username && p.Password == password);
            if (result == null)
            {
                return false;
            }
            return true ;
        }

        // Get data from database
        public Account GetData(string username, string password)
        {

 	        throw new NotImplementedException();
        }

        //upload data to server
        public bool UploadData(string username, string password, Models.Account data)
        {

 	        throw new NotImplementedException();
        }



        public Account CreateUser(string username, string password, string Email)
        {

            throw new NotImplementedException();
        }
    }
}
